Repository navigation
fix(make): admit substitution before allocation - #2721
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | c313597 | Commit Preview URL Branch Preview URL |
Oct 14 2026, 01:46 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Make substitution now admits its checked output size before constructing it. Arguments and generated expansion buffers use the shared execution budget, and immutable variable values retain their capacity leases through parser copies, replacement and recipe preparation. Matching and copying check work, cancellation and deadlines.
Why
The previous
$(subst)implementation allocated its complete replacement before checking the remaining 4 MiB expansion allowance. The later size error could not protect that allocation.Before / After
Tiny admission regression: a four-byte replacement with three bytes of remaining allowance previously returned success from substitution; it now returns
expansion exceeds 4 MiBbefore result construction. The same replacement is accepted with four bytes remaining. Numeric overflow checks allocate no output.Ordinary Unicode, immediate/recursive/append assignment and recipe proof, identical through Bashkit CLI and GNU Make:
Empty-pattern behavior remains covered by an ordinary fixture. Tiny ownership tests prove retained results survive expander drop and share their lease through clones, then release it with the last owner. New tests contain no recursive amplification chain or oversized allocation.
Validation:
just pre-pr,just test(including serialized failpoints), all-target/all-feature and lean clippy, warning-denied rustdoc, OKF/doc/workflow checks, 162 repository-script tests, tiny admission/ownership fixtures and ordinary CLI/GNU Make output comparison all passed. Existing benchmark harnesses passed their ordinary echo cases; no Make-specific performance claim is made.Unchanged CI passed on
c313597c, including the aggregate Check gate.Risk
Medium: Make-generated text now counts toward the configured live-memory/work limits throughout its lifetime. Ordinary substitution and assignment semantics are retained. Other Make function algorithms and raw makefile storage remain outside this focused pre-allocation repair.
Checklist